﻿using System;
using System.Data;
using System.Text;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using AnyOffice.Components;
using AnyOffice.DAL;
namespace AnyOffice.general.meeting.apply
{
    public partial class index1 : ModulePage
    {


        protected void Page_Load(object sender, EventArgs e)
        {
            ConfigManager manager = new ConfigManager();
            UserCache cache = new UserCache();
            int privId = cache.PrivId;
            int administratorPrivId = manager.AdministratorPrivId;
            DataTable table = new MeetingDao().SelectApplyAll(base.Conn, base.User.Identity.Name);
            DataView defaultView = table.DefaultView;
            defaultView.RowFilter = "Status=0";
            if (defaultView.Count > 0)
            {
                this.rptMeeting0.DataSource = defaultView;
                this.rptMeeting0.DataBind();
            }
            else
            {
                this.litMessage0.Text = base.ShowMessage("无待批会议");
            }
            DataView view2 = table.DefaultView;
            view2.RowFilter = "Status=1 AND NOT(StartTime <'" + DateTime.Now.ToString() + "' AND EndTime > '" + DateTime.Now.ToString() + "')";
            if (view2.Count > 0)
            {
                this.rptMeeting1.DataSource = view2;
                this.rptMeeting1.DataBind();
            }
            else
            {
                this.litMessage1.Text = base.ShowMessage("无已准会议");
            }
            DataView view3 = table.DefaultView;
            view3.RowFilter = "Status=1 AND StartTime <'" + DateTime.Now.ToString() + "' AND EndTime > '" + DateTime.Now.ToString() + "'";
            if (view3.Count > 0)
            {
                this.rptMeetingNow.DataSource = view3;
                this.rptMeetingNow.DataBind();
            }
            else
            {
                this.litMessageNow.Text = base.ShowMessage("无进行中会议");
            }
            DataView view4 = table.DefaultView;
            view4.RowFilter = "Status=2";
            if (view4.Count > 0)
            {
                this.rptMeeting2.DataSource = view4;
                this.rptMeeting2.DataBind();
            }
            else
            {
                this.litMessage2.Text = base.ShowMessage("无未批准会议");
            }
        } 

    }
}
